<template>
  <div>
    <div v-if="$route.name == '系统配置' ">
      <!--pageheader-->
      <div
        id="contentwrapper"
        class="contentwrapper"
      >
        <div class="row">
          <div class="col-lg-12">
            <div class="panel">
              <div class="panel-heading">
                <h4>1 系统配置</h4>
              </div>
              <div class="panel-body">
                <div class="row">
                  <div class="col-md-6 col-xs-12">
                    <div class="f14px-50b"><a @click="go({name:'14 权限配置'})">1.1 权限配置</a></div>
                    <div class="f14px-50b"><a @click="go({name:'15 重置密码'})">1.2 重置密码</a></div>

                    <div class="f14px-50b"><a @click="go({name:'16 登录日志'})">1.3 登录日志 </a></div>
                    <div class="f14px-50b"><a @click="go({name:'17 表锁定'})">1.4 表锁定 </a></div>

                  </div>
                  <div class="col-md-6 col-xs-12">
                     <div class="f14px-50b"><a @click="go({name:'18 任务发布'})">1.5 任务发布 </a></div>
                  
                     <div class="f14px-50b"><a @click="go({name:'19 数据检测'})">1.6 数据检测 </a></div>
                    <div class="f14px-50b"><a @click="go({name:'20 数据上报'})">1.7 数据上报</a></div>
                      <div class="f14px-50b"><a @click="go({name:'21 查看任务'})">1.8 查看任务 </a></div>
                    <div class="f14px-50b"><a @click="go({name:'22 指标及数据项目关联性检测'})">1.9 指标及数据项目关联性检测 </a></div>
                  
                  </div>

                </div>
                

              </div>

            </div>
          </div>
        </div>

      </div>
    </div>
    <div v-else>
      <router-view />
    </div>
  </div>
</template>
<script>
import { getUser } from "@/utils/auth";

export default {
  components: {
    // ListItem: {
    //   name: "ListItem",
    //   template: `<div style="width:100%"><div style='width:20%;margin-left:10px;'  v-for="item in data"><el-button  @click="go(item)" type='text'>{{item.title}}</el-button><ListItem :data="item.children"/></div></div>`,
    //   props: ["data"],
    //   methods: {
    //     go(item) {
    //       var user = getUser();
    //       if (
    //         user.ROLE_INPUT.indexOf("admin") !== -1
    //       ) {
    //         this.$router.push({
    //           path: "/系统配置/"+item.name,
    //           params: {
    //             mode: "view",param:item.param
    //           }
    //         });
    //       } else {
    //         this.alert("你没有权限浏览");
    //       }
    //     }
    //   }
    // }
  },
  data() {
    return {};
  },

  methods: {
    go(item) {
      var user = getUser();
      
     
      if (user.ROLE_INPUT.indexOf("admin") !== -1) {
        this.$router.push({
          name: item.name,
          params: {
            mode: "input",
            param: item.param
          }
        });
      } else {
        this.$alert("你不能配置权限");
      }
    }
  }
};
</script>

